လက်ရှိတည်နေရာ: ပင်မစာမျက်နှာ> ဖန်ရှင်အမျိုးအစားများ> property_exists

property_exists

အရာဝတ်ထုတစ်ခုသို့မဟုတ်အတန်းအစားသည်ဤပိုင်ဆိုင်မှုရှိ,
အမည်:property_exists
အမျိုးအစား:အတန်းများနှင့်အရာဝတ်ထု
programming language:php
တစ်ကြောင်းဖြင့်အကျဉ်းချုပ်:အရာဝတ်ထုတစ်ခုသို့မဟုတ်အတန်းအစားသတ်မှတ်ထားသော attribute ကိုရှိမရှိစစ်ဆေးသည်

function name: Property_exists ()

function ကိုဖော်ပြချက်: Monthent_exists () function ကို) အရာဝတ်ထုတစ်ခုသို့မဟုတ်အတန်းအစားသည်သတ်မှတ်ထားသော attribute ကိုရှိမရှိစစ်ဆေးသည်။

Parametermer

  • $ အတန်းအစား: လိုအပ်သည်။ class name သို့မဟုတ် check လုပ်ထားရန်အရာဝတ်ထု။
  • $ အိမ်ခြံမြေ: လိုအပ်သည်။ စစ်ဆေးရန် attribute ကိုအမည်။

Value ကိုပြန်သွားပါ

  • ပစ္စည်းဥစ်စာပိုင်ဆိုင်မှုတည်ရှိပြီးလက်လှမ်းမီလျှင်စစ်မှန်သောပြန်လာ။
  • အကယ်. ပစ္စည်းဥစ်စာပိုင်ဆိုင်မှုမရှိပါကသို့မဟုတ်လက်လှမ်းမမီနိုင်ပါကမှားယွင်းစွာပြန်လာသည်။

သက်ဆိုင်သောဗားရှင်း - PHP 4, PHP 5, PHP 7

အသုံးပြုမှုဥပမာ -

  1. အတန်းအစားသတ်မှတ်ထားသော attribute ကိုရှိမရှိစစ်ဆေးပါ။
 class MyClass { public $name = "John"; private $age = 25; } $object = new MyClass(); if (property_exists($object, 'name')) { echo "The 'name' property exists."; } else { echo "The 'name' property does not exist."; } // 输出:The 'name' property exists.
  1. အရာဝတ်ထုတွင်သတ်မှတ်ထားသော attribute ကိုရှိ, မရှိစစ်ဆေးပါ။
 class MyClass { public $name = "John"; private $age = 25; } $object = new MyClass(); if (property_exists($object, 'age')) { echo "The 'age' property exists."; } else { echo "The 'age' property does not exist."; } // 输出:The 'age' property does not exist.
  1. Class Name သည်သတ်မှတ်ထားသော static attribute ကိုရှိမရှိစစ်ဆေးပါ။
 class MyClass { public static $name = "John"; private static $age = 25; } if (property_exists('MyClass', 'name')) { echo "The 'name' static property exists."; } else { echo "The 'name' static property does not exist."; } // 输出:The 'name' static property exists.
  1. အတန်းအစားအမည်မှာသတ်မှတ်ထားသော static private attribute ကိုရှိမရှိစစ်ဆေးပါ။
 class MyClass { public static $name = "John"; private static $age = 25; } if (property_exists('MyClass', 'age')) { echo "The 'age' static property exists."; } else { echo "The 'age' static property does not exist."; } // 输出:The 'age' static property does not exist.
သက်ဆိုင်သောဖင်ခှ်ရှင်းများ
  • "နှောင်းပိုင်း static binding" အတန်းအစား၏အမည် get_called_class

    get_called_class

    "နှောင်းပိုင်းs
  • အရာဝတ်ထုဂုဏ်သတ္တိများရေးထားသည့် assementive ခင်းကျင်းမှုကိုသင်ရေးရန်ပြန်သွားပါ get_object_vars

    get_object_vars

    အရာဝတ်ထုဂုဏ်သတ္တိမျာ
  • အရာဝတ်ထုသည်ဤအတန်းကို၎င်း၏မိဘအတန်းအစားတစ်ခုအဖြစ်ယူရန်သို့မဟုတ်အကောင်အထည်ဖော်ခြင်းရှိမရှိစစ်ဆေးသည်။ ဤအရာဝတ်ထုသည်အတန်း၏ subclass ဖြစ်သည် is_subclass_of

    is_subclass_of

    အရာဝတ်ထုသည်ဤအတန်းကို
  • အရာဝတ်ထုသို့မဟုတ်အတန်းအစား၏မိဘအတန်းအစားအမည်ကိုပြန်လည်ရောက်ရှိ get_parent_class

    get_parent_class

    အရာဝတ်ထုသို့မဟုတ်အတန
  • အတန်းကိုသတ်မှတ်လျှင်စစ်ဆေးပါ class_exists

    class_exists

    အတန်းကိုသတ်မှတ်လျှင်
  • အားလုံးကြေငြာသော interfaces များပါ 0 င်သည့်ခင်းကျင်းမှုကိုပြန်ပေးပါ get_declared_interfaces

    get_declared_interfaces

    အားလုံးကြေငြာသောinte
  • အရာဝတ်ထုရဲ့အတန်းအစားအမည်ကိုပြန်သွားပါ get_class

    get_class

    အရာဝတ်ထုရဲ့အတန်းအစား
  • အတန်း၏ပုံမှန်ဂုဏ်သတ္တိများ၏ခင်းကျင်းပြန်လည်ရောက်ရှိ get_class_vars

    get_class_vars

    အတန်း၏ပုံမှန်ဂုဏ်သတ္
လူကြိုက်များသော ဆောင်းပါးများ